﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EWC.Core.Application.Dtos
{
    public class PagedResultDto<T>
    {
        /// <summary>
        /// 当前第几页
        /// </summary>
        public int PageIndex { get; set; }

        /// <summary>
        /// 每页多少条数据
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// 总共多少条数据
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalPages => Convert.ToInt32(Math.Ceiling((double)TotalCount / PageSize));

        /// <summary>
        /// 数据
        /// </summary>
        public IList<T> Items { get; set; }
    }
}
